var $;
var element;
var form;
var table;
var laydate;
var status;
var layer;

function child(id,deptName,createName,createDate,deptDescirbe) {
    $('input[name = deptName]').val(deptName);
    $('input[name = id]').val(id);
    $('input[name = trueName]').val(createName);
    $('input[name = createDate]').val(createDate);
    $('#deptDescirbe').text(deptDescirbe);
}
layui.use(['jquery','element','form','table','laydate','layer'],function () {
    $ = layui.$;
    element = layui.element;
    form = layui.form;
    table = layui.table;
    laydate = layui.laydate;
    layer = layui.layer;
    /* */
});

function sub() {
    var deptName = $('input[name = deptName]').val();
    var deptDescirbe = $('#deptDescirbe').text();
    var id = $('input[name = id]').val();
    $.ajax({
        url:'/Department/updateDept',
        data:{"deptName":deptName,"deptDescirbe":deptDescirbe,"id":id},
        dataType:'json',
        success:function (data) {
            if(data.data){
                var layer = parent.layer;
                layer.close(layer.index);
                layer.msg("修改成功");
            }else{
                var layer = parent.layer;
                layer.close(layer.index);
                layer.msg("修改失败");
            }
        }
    });
}

//关闭
function cancel() {
    var layer = parent.layer;
    layer.close(layer.index);
}